make autofix configurable through in-editor configuration #2063
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some editors like VS Code and Sublime Text offer their own setting to configure code actions on save,
editor.codeActionsOnSave
andlsp_code_actions_on_save
respectively. These options should be preferred overenable_autofix
if possible. Theenable_autofix
gets renamed toforce_autofix
to reflect that it should only be used on editors that don't support code actions on save.fixes #1093
List of editors that should be checked for the best way to implement autofix (code action on save or force_autofix):
editor.codeActionsOnSave
lsp_code_actions_on_save
code_actions_on_format
(haven't checked whether it actually works)force_autofix
but the ux is too bad)vim.lsp.buf.code_action
CocAction
eglot-code-action
force_autofix
)How To Upgrade
Please checkout the Installation Guide and go to the documentation of your editor. Do not blindly change
enable_autofix
toforce_autofix
!